function createLine(data){
				for(var i=0;i<data.content.length;i++){
					var tab=document.getElementById("tab")
					var tr=document.createElement("tr")
					tr.setAttribute("_id",JSON.stringify(data.content[i].id))


					var td=document.createElement("td")
					td.textContent=data.content[i].member
					tr.appendChild(td)

					var td=document.createElement("td")
					td.textContent=data.content[i].number
					tr.appendChild(td)

					var td=document.createElement("td")
					td.textContent=data.content[i].vehicle
					tr.appendChild(td)

					var td=document.createElement("td")
					td.textContent=data.content[i].site
					tr.appendChild(td)


					var td=document.createElement("td")
					td.textContent=data.content[i].date
					tr.appendChild(td)

					var td=document.createElement("td")
					tr.setAttribute("consumption",data.content[i].consumption)
					td.textContent=data.content[i].consumption
					tr.appendChild(td)


					var td=document.createElement("td")
					td.textContent=data.content[i].oil
					tr.appendChild(td)

					var td=document.createElement("td")
					td.textContent=data.content[i].capacity.toFixed(2)
					tr.appendChild(td)

					var td=document.createElement("td")
					td.textContent=data.content[i].operator
					tr.appendChild(td)

					var td=document.createElement("td")
					var btn=document.createElement("button")
					var status=data.content[i].settled_fee
					btn.textContent="未结算"
					if (status==="未结算"){
						btn.className="btn btn-xs btn-danger"
					}
					if (status==="预结算"){
						btn.className="btn btn-xs btn-primary"
					}
					else{
						btn.className="btn btn-xs btn-success"
					}
					td.appendChild(btn)
					tr.appendChild(td)

					var td=document.createElement("td")
					td.textContent=data.content[i].settled_date
					tr.appendChild(td)

					tab.appendChild(tr)
			}
			settle()
}
function settle(){
	var data_id=[]
	$("tbody>tr").each(function(){
		var _id= $(this).attr("_id")
		data_id.push(_id)
	})
	_data=JSON.stringify(data_id)
	$.ajax({
		"url":"/settle/",
		"error":errorAjax,
		"beforeSend":start_load_pic,
		"complete":stop_load_pic,
		"data":{"data":_data,"action":"pre"},
		"type":"POST",
		"success":function(data){
			if(responseCheck(data)){
				setTimeout(window.print,1000)
			}
		}
	})
}
var x={"content":window.opener.data}
console.log(x)
createLine(x)
	var b=0
	$("tbody tr").each(function(){
		var _b=$(this).attr("consumption")
		_b=parseFloat(_b)
		b+=_b
	})
$("#title").text("当前已选中金额为: "+b +"元")
